/* eslint-disable no-unused-vars */
import React, { memo } from "react";
import { Icon } from "@antmjs/vantui";
import { View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import "./index.less";

const Index = (props) => {
    const { onClick,top } = props;
    const handleBackTop = () => {
        if (onClick) {
            onClick();
            return
        }
        Taro.pageScrollTo({
            scrollTop: 0,
            duration: 500
        })
    }
    return (
        <>
            <View className='back-top' onClick={handleBackTop} style={{top:top}}>
                <Icon name='arrow-up' color='#000000' size='50' className='icon-top' />
            </View>
        </>
    );
};

export default memo(Index);
